//
//  CheckNetwork.m
//  oschina
//
//  Created by wangjun on 12-3-5.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "CheckNetwork.h"
#import "Reachability.h"

@implementation CheckNetwork
+(BOOL)isExistenceNetwork
{
	BOOL isExistenceNetwork;
	Reachability *reachability = [Reachability reachabilityWithHostname:@"www.oschina.net"];
    switch ([reachability currentReachabilityStatus]) {
        case NotReachable:
			isExistenceNetwork=FALSE;
               NSLog(@"无网络连接");
            break;
        case ReachableViaWWAN:
			isExistenceNetwork=TRUE;
               NSLog(@"连接3G网络");
            break;
        case ReachableViaWiFi:
			isExistenceNetwork=TRUE;
              NSLog(@"连接wifi网络");
            break;
    }
	return isExistenceNetwork;
    
    return YES;
}
@end
